<template>
	<view class="pages">
		<form @submit="affirm">
			<view class="remark">
				<textarea :value="remark" placeholder="填写您的备注(选填)" placeholder-style="color: #878787;font-size:12px;" @input="bindTextArea" name="remark" />
				<text>{{cursor}}/140</text>
			</view>
			<button form-type="submit">确认备注</button>
		</form>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				remark: '',
				cursor: 0,
			}
		},
		onLoad(e) {
			this.remark = e.remark;
		},
		methods:{
			//右上角分享功能
			onShareAppMessage: function (res) {
			  return {
			    title: 'unclearcare 球鞋洗护',
			    path: '/pages/index/index',
			    success: function (res) {
				  // 转发成功
			    },
			    fail: function (res) {
				  // 转发失败
			    }
			  }
			},
			bindTextArea(e){//输入框输入事件
				this.cursor = e.detail.cursor;
			},
			affirm(e){
				var remark = e.detail.value.remark;
				uni.setStorageSync("remark", remark);
				uni.navigateBack({
					delta: 1
				})
			}
		}
		
	}
</script>

<style lang="scss">
	page{
		min-height: 100%;
	}
	.pages{
		min-height: 100%;
		background-color: #fff;
		padding: 20upx;
		.remark{
			position: relative;
			height: 200upx;
			textarea{
				width: 100%;
				height: 100%;
				color: #878787;
				font-size:12px;
				background-color: #f5f5f9;
				padding: 20upx;
			}
			text{
				position: absolute;
				bottom: 20upx;
				right: 30upx;
				font-size: 24upx;
				color: #878787;
			}
		}
		button{
			height: 80upx;
			line-height: 80upx;
			background-color: #000;
			color: #fff;
			margin-top: 20upx;
			font-size: 30upx;
		}
	}
</style>
